package com.hzhjhh.view.manageView.menus.query.enums;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 菜单栏初始化-查询-销售统计-展示字段映射enum
 * 
 * @author 12083
 *
 */
@Getter
@AllArgsConstructor
public enum SaleStatisticsShowEnum {

	CODE("saleProductId", "商品编码"),
	NAME("saleProductName", "商品名称"),
	NUM("saleNumber", "销售数量"),
	AMT("salePrice", "销售金额"),
	DATE("saleDate", "销售日期"),
	AMT_SUBTOTAL("amtSubtotal", "金额小计"),
	;
	
	/**
	 * 列对应的code
	 */
	private final String columnCode;
	/**
	 * 列展示时候的名称
	 */
	private final String columnName;
	
	public static Map<String, String> descMap() {
		return Arrays.asList(SaleStatisticsShowEnum.values())
				.stream()
				.collect(Collectors.toMap(SaleStatisticsShowEnum::getColumnName, SaleStatisticsShowEnum::getColumnCode, (v1, v2) -> v1));
	}
	public static Map<String, String> toMap() {
		return Arrays.asList(SaleStatisticsShowEnum.values())
				.stream()
				.collect(Collectors.toMap(SaleStatisticsShowEnum::getColumnCode, SaleStatisticsShowEnum::getColumnName, (v1, v2) -> v1));
	}
}
